package com.zhoutao.blog.seven.dao.repository;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhoutao.blog.seven.dao.mapper.UserMapper;
import com.zhoutao.blog.seven.dao.model.UserDao;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

@Slf4j
@Service
public class UserRepository extends ServiceImpl<UserMapper, UserDao> {


    public UserDao findByUsername(String username) {
        LambdaQueryWrapper<UserDao> wrapper = new LambdaQueryWrapper<UserDao>();
        wrapper.eq(UserDao::getUsername, username);
        return this.getOne(wrapper);
    }
}
